#pragma once
#include "..\General.hpp"

class Button : private sf::Thread
{
	public:
		Button();
		void Create(int x, int y);

		void LoadSound(FMOD::System *system, std::string Name);
		void Play(FMOD::System *system);
		void Stop();
		void ResetButton();
		void SetVolume(int Volume);

		bool IsSoundLoaded();
		bool IsSoundPlaying();

		void Draw(sf::RenderWindow &App, FMOD::System *system);

		sf::Shape UpdateBtn();
		sf::Shape GetBtn();


	private:
		int BtnX, BtnY;

		FMOD::Sound *sound;
		FMOD::Channel *channel;

		sf::Shape Btn;

		bool Paused;
		bool isPlaying;

		unsigned int Length;
		unsigned int Pos;

		FMOD::System *SysTemp;
		char *NameTemp;


		virtual void Run();
};

class RndButton
{
public:
	void Create(int x, int y);
	int BtnX, BtnY;
	RndButton();

	bool IsLineActive;
	bool IsLinePlaying;

	void Draw(sf::RenderWindow &App, FMOD::System *system);

	sf::Shape UpdateBtn();
	sf::Shape GetBtn();

	void Play(FMOD::System *system);

private:
	sf::Shape RndBtn;
};